<template>
    <div class="skeleton-wrap">
        <van-skeleton>
            <template #template>
                <div class="skeleton-box">
                    <van-skeleton-paragraph style="width: 22px;height: 22px;border-radius: 11px;margin-right: 5px;" v-if="isChecked"/>
                    <van-skeleton-image class="image" :style="'width: '+ width +';height: '+ height +';'"/>
                    <div class="text">
                        <div class="left">
                            <van-skeleton-paragraph row-width="40%" style="height: 30px;margin: 5px 0;" />
                            <van-skeleton-paragraph row-width="70%" v-if="isLeftSecondRow"/>
                        </div>
                        <div class="right" v-if="isRight">
                            <van-skeleton-paragraph row-width="50%" style="margin: 5px 0;"/>
                            <van-skeleton-paragraph row-width="50%"/>
                        </div>
                    </div>
                </div>
            </template>
        </van-skeleton>
    </div>
</template>

<script lang="ts" setup>
withDefaults(defineProps<{
    isRight?: boolean
    isLeftSecondRow?: boolean
    isChecked?: boolean
    width?: string
    height?: string
}>(), {
    isRight: true,
    isLeftSecondRow: true,
    isChecked: false,
    width: '65px',
    height: '65px'
})
</script>

<style scoped lang="scss">
::v-deep(.van-skeleton) {
    padding: 0px 0px;
}
.skeleton-wrap {
    background-color: #fff;
    padding: 10px 0;
    .skeleton-box {
        display: flex;
        align-items: center;
        width: 100%;
        padding-left: 5px;
        .image {
            width: 65px;
            height: 65px;
            border-radius: 5px;
        }
        .text {
            flex: 1;
            margin-left: 10px;

            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #EDEDED;
            padding: 20px 10px 20px 0;
            .left {
                flex: 1;
            }
            .right {
                width: 45px;
            }
        }
    }
}
</style>